package app.tasks.schedule;

import app.env.Data;
import app.agent.Schedule;
import jade.core.behaviours.OneShotBehaviour;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @Name: InitBehaviour
 * @Description:
 * @Author: colfish
 * @Date: 2021/4/10 23:43
 * 好好学习，天天向上！
 */
public class Init extends OneShotBehaviour {
    private Schedule schedule;
    private Logger logger = LogManager.getLogger(this.getClass());

    public Init(Schedule schedule){
        this.schedule = schedule;
    }

    @Override
    public void action() {
        schedule.doWait(5000);
        schedule.initPopulation(Data.SEARCH_NUMS);
        logger.info("AdminAgent: <" + schedule.getLocalName() +"> Init Finished...");
    }
}
